package com.hxc.service.impl;

import com.hxc.dao.UserMapper;
import com.hxc.pojo.User;
import com.hxc.service.UserService;
import com.hxc.util.Constans;
import com.hxc.util.Funcs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserMapper userMapper;

    @Override
    public int selectUser(User user) {
        user.setPassword(Funcs.MD5(user.getPassword()+ Constans.PASSWORD_SALT_KEY));
        return userMapper.selectUser(user);
    }

    @Override
    public int findByName(String userName) {
        return userMapper.findByName(userName);
    }
}
